<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head>
    <th:block th:include="include :: header('查看app账号')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-account-add"  th:object="${appPhone}">
        <input id="appId" name="appId" type="hidden" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">手机号：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="phoneNum" id="phoneNum" style="height: 34px;" th:field="*{phone}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">Cookie：</label>
            <div class="col-sm-8" style="display: flex">
                <input class="form-control" type="text" name="cookie" id="cookie" required style="height: 34px;" placeholder="获取cookie中...">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">
    $(function() {
        var appId = $("#appId").val();
        console.log(appId);
        $.ajax({
            cache: true,
            type: "POST",
            url: ctx + "system/app/getCookie?id=" + appId,
            dataType: "json",
            contentType: "application/json",
            async: false,
            error: function(req) {
                $("input[name='cookie']").val("获取cookie失败")
            },
            success: function (data) {
                console.log(data)
                $("input[name='cookie']").val(data.msg)
            },
        })
    });
</script>
</body>
</html>
